<!--
 * @Author: 宋绍华
 * @Date: 2024-11-06 17:14:48
 * @LastEditors: wangshuixin 2412658453@qq.com
 * @LastEditTime: 2025-01-03 16:20:15
 * @FilePath: \sr_system_manager_ui\src\components\Editor\index.vue
 * @Description: 
-->
<template>
  <div>
    <x-editor
      v-model="props.modelValue"
      v-bind="$attrs"
      :height="props.height"
      :minHeight="props.minHeight"
      :readOnly="props.readOnly"
      :fileSize="props.fileSize"
      :type="props.type"
      :uploadUrl="props.uploadUrl"
    />
  </div>
</template>

<script setup>
const props = defineProps({
  /* 编辑器的内容 */
  modelValue: {
    type: String,
  },
  /* 高度 */
  height: {
    type: Number,
    default: null,
  },
  /* 最小高度 */
  minHeight: {
    type: Number,
    default: null,
  },
  /* 只读 */
  readOnly: {
    type: Boolean,
    default: false,
  },
  /* 上传文件大小限制(MB) */
  fileSize: {
    type: Number,
    default: 5,
  },
  /* 类型（base64格式、url格式） */
  type: {
    type: String,
    default: "url",
  },
  // 上传的图片服务器地址
  uploadUrl: {
    type: String,
    default: import.meta.env.VITE_APP_BASE_API + "/base/api/attachment/upload",
  },
});
</script>
